home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / disk-man / mtools-3.000 / mtools-3 / mtools-3.0 / streamcache.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-01-31  |  1.6 KB  |  52 lines

  1. #ifndef MTOOLS_STREAMCACHE_H
  2. #define MTOOLS_STREAMCACHE_H
  3.  
  4. #include <sys/param.h>
  5. #include "vfat.h"
  6.  
  7. typedef struct StreamCache_t {
  8.     /* stuff needing to be initialised by the caller */
  9.     int (*callback)(Stream_t *Dir, struct StreamCache_t *sc, int entry);
  10.     int (*unixcallback)(char *name, struct StreamCache_t *sc);
  11.     int (*newdoscallback)(char *name, struct StreamCache_t *sc);
  12.     int (*newdrive_cb)(Stream_t *Dir, struct StreamCache_t *sc);
  13.     int (*olddrive_cb)(Stream_t *Dir, struct StreamCache_t *sc);
  14.     void *arg; /* to be passed to callback */
  15.  
  16.            int openflags; /* flags used to open disk */
  17.     int lookupflags; /* flags used to lookup up using vfat_lookup */
  18.  
  19.     char *outname; /* where to put the matched file name */
  20.     char *shortname; /* where to put the short name of the matched file */
  21.     char *longname; /* where to put the long name of the matched file */
  22.     char *pathname; /* path name of file */
  23.     char filename[VBUFSIZE];
  24.     char drivename;
  25.  
  26.     /* out parameter */
  27.     Stream_t *File;
  28.     Stream_t *Fs; /* open drive corresponding to File, for callback */
  29.     struct directory dir;
  30.  
  31.     /* internal data */
  32.     char last_drive; /* last opened drive */    
  33.     char mcwd[MAXPATHLEN];    
  34.     Stream_t *fss[256]; /* open drives */
  35.     char subdir_name[VBUFSIZE];
  36.     Stream_t *subdir;    
  37. } StreamCache_t;
  38.  
  39. Stream_t *open_subdir(StreamCache_t *StreamCache, char *arg, 
  40.               int flags, Stream_t **Fs);
  41. void init_sc(StreamCache_t *StreamCache);
  42. void finish_sc(StreamCache_t *StreamCache);
  43. int main_loop(StreamCache_t *StreamCache, char *progname, 
  44.           char **argv, int argc);
  45.  
  46. #define NEXT_DISK 1
  47. #define MISSED_ONE 2
  48. #define GOT_ONE 4
  49. #define IS_MATCH 8
  50.  
  51. #endif
  52.